package com.jianneng.jdg.model.homeactivity;

import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentActivity;
import android.support.v4.app.FragmentTransaction;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.Window;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.example.com.jianneng.jdg.R;
import com.jianneng.jdg.model.adapter.ReprotMoneyAdapter;
import com.jianneng.jdg.model.fragment.FragmentCircle;
import com.jianneng.jdg.model.fragment.FragmentEntrance;
import com.jianneng.jdg.model.fragment.FragmentMyNews;
import com.jianneng.jdg.model.fragment.FragmentMyWork;
import com.jianneng.jdg.model.fragment.FragmentSchool;
import com.jianneng.jdg.model.gallery.MyWorkerService;
import com.jianneng.jdg.model.view.SearchDevicesView;

public class ReportMoneyActivity extends BaseActivity implements OnClickListener,OnItemClickListener{
private LinearLayout mBack;
private ListView mReportListView;//上报工资
private ReprotMoneyAdapter mReportAdapter;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        requestWindowFeature(Window.FEATURE_NO_TITLE);  
        setContentView(R.layout.activity_reportmoney);
        initView();
        Intent intent = getIntent();
        String workerId = intent.getStringExtra("worker_id");
        if("manager".equals(workerId)){
        	mReportAdapter = new ReprotMoneyAdapter(this, MyWorkerService.getReportMoney());
        	mReportListView.setAdapter(mReportAdapter);
        	mReportListView.setOnItemClickListener(this);
	        }
    }

	private void initView() {
		mBack = (LinearLayout) findViewById(R.id.report_back);
		mReportListView = (ListView) findViewById(R.id.report_listview);
		mBack.setOnClickListener(this);
	}
	
	@Override
	public void onClick(View v) {
		switch (v.getId()) {
		case R.id.report_back :
			finish();
			break;
		default:
			break;
		}
	}

	@Override
	public void onItemClick(AdapterView<?> parent, View view, int position,
			long id) {
		Intent intent =new Intent(ReportMoneyActivity.this, ReportMoneyDetailActivity.class);
		startActivity(intent);
		
	}
	

}
	


